package com.base.hong.ui.project.viewmodel

import androidx.lifecycle.MutableLiveData
import com.base.hong.model.BannerEntity
import com.base.hong.model.ProjectListEntity
import com.base.hong.model.ProjectTitleEntity
import com.base.hong.repository.ZLRepository
import com.htt.base_library.base.BaseVModel
import okhttp3.RequestBody

/**
 *
 *Create by Hong on 2023/4/13 16:09.
 *
 */
class ProjectViewModel :BaseVModel(){


    val projectTitle: MutableLiveData<ProjectTitleEntity> = MutableLiveData()
    val projectList: MutableLiveData<ProjectListEntity> = MutableLiveData()
    private val repository: ZLRepository by lazy {
        ZLRepository()
    }


    fun getProjectTitle() {
        launch({
            repository.getProjectTitle()
        }, { bean ->
            projectTitle.value = bean.data
        }, isShowDialog = false)
    }
    fun getProjectList(page_size:Int, cid :Int) {
        launch({
            repository.getProjectList(page_size,cid)
        }, { bean ->
            projectList.value = bean.data
        }, isShowDialog = false)
    }

}